#pragma once
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <vector>

#define HIGHT 20
#define WIDTH 60
using namespace std;

class Position
{
public:
    int x, y;
    int flag=1;
};
class Snake
{
public:
    Position head;
    vector<Position> body;
    int size;
    Snake()
    {
        //蛇初始化
        size = 2;//头加身体的长度
        head.x = WIDTH / 2;
        head.y = HIGHT / 2;
        body.push_back({ WIDTH / 2 - 1, HIGHT / 2 });
   
    }
};

class Food
{
public:
    int x ;
    int y;
    Food(int a = rand()%60+1, int b = rand()%20+1) :x(a), y(b) {
        
   }
    
};

int kx = 0;//记录wasd使蛇头坐标值的改变
int ky = 0;
Snake s1;//创建蛇
vector<Food> f(6);
int score = 0;